package cn.shengchao.examstar.ai.domain.exception;

/**
 * 无效学习计划异常
 * 当学习计划违反业务规则时抛出此异常
 */
public class InvalidStudyPlanException extends StudyPlanDomainException {
    
    public InvalidStudyPlanException(String message) {
        super(message);
    }
    
    public InvalidStudyPlanException(String message, Throwable cause) {
        super(message, cause);
    }
    
    /**
     * 创建参数无效异常
     */
    public static InvalidStudyPlanException invalidParameter(String parameterName, Object value) {
        return new InvalidStudyPlanException(
            String.format("参数[%s]无效: %s", parameterName, value)
        );
    }
    
    /**
     * 创建业务规则违反异常
     */
    public static InvalidStudyPlanException businessRuleViolation(String rule) {
        return new InvalidStudyPlanException("违反业务规则: " + rule);
    }
    
    /**
     * 创建状态转换异常
     */
    public static InvalidStudyPlanException invalidStateTransition(String fromState, String toState) {
        return new InvalidStudyPlanException(
            String.format("无效的状态转换: 从[%s]到[%s]", fromState, toState)
        );
    }
}